//toggles between low and high power (1dBm -> 20dBm)

void GPIO2SwitchCheck()
{
  byte rf22reg = rf22.spiRead(RF22_REG_0E_IO_PORT_CONFIGURATION) & (1<<2);
  //Serial.println(rf22reg, BIN);
  //rf22reg &= (1<<2);
  
   if (GPIO2 != rf22reg)
  {
    GPIO2 = rf22reg;
    if (GPIO2)
    {
      digitalWrite(redLED, HIGH);
      rf22.setTxPower(RF22_TXPOW_20DBM);
    }
    else
    {
      digitalWrite(redLED, LOW);
      rf22.setTxPower(RF22_TXPOW_1DBM);
    }
  }
}
